<?php

namespace Beerus\Modules\Designer\Actions;

use Biz\tools\FileUpload;
use Illuminate\Http\Request;
use Encore\Admin\Actions\RowAction;
use Doraemon\model\KaDesigner;
use App\Admin\Controllers\FileController;

class DownFile extends RowAction
{
    public $name = '合同下载';

    public function handle($id)
    {
        $url = "ka/{$id}/downfile";
        return $this->response()->success('下载成功Y(^o^)Y')->download($url);
    }

    public function retrieveModel(Request $request)
    {
        if (!$key = $request->get('_key')) {
            return false;
        }

        return $key;
    }

}
